negotiator.boaframework.omstrategy
Class OfferBestN

java.lang.Object
  extended by negotiator.boaframework.OMStrategy
      extended by negotiator.boaframework.omstrategy.OfferBestN

public class OfferBestN
extends OMStrategy

This class uses an opponent model to determine the next bid for the opponent, while taking the opponent's preferences into account. The opponent model is used to select the N best bids. Following, a random bid is selected from this subset. Setting N > 1 is rational, as opponent models cannot be assumed to be perfect. Due to performance reasons, it is recommended to use BestBid if N = 1.

Author:
Mark Hendrikx

Field Summary
 
Fields inherited from class negotiator.boaframework.OMStrategy
model, negotiationSession
 
Constructor Summary
OfferBestN()
          Empty constructor used for reflexion.
OfferBestN(NegotiationSession negotiationSession, OpponentModel model, int n)
          Normal constructor used to initialize the OfferBestN opponent model strategy.
 
Method Summary
 boolean canUpdateOM()
          Specifies that the opponent model may be updated when the current time is smaller than the deadline.
 BidDetails getBid(java.util.List<BidDetails> allBids)
          First this method determines the N best bids given the array of similarly preferred bids.
 void init(NegotiationSession negotiationSession, OpponentModel model, java.util.HashMap<java.lang.String,java.lang.Double> parameters)
          Initializes the agent by storing the size of the domain, and checking if the domain is large.
 
Methods inherited from class negotiator.boaframework.OMStrategy
getBid, getBid, init, setOpponentModel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OfferBestN

public OfferBestN()
Empty constructor used for reflexion. Note this constructor assumes that init is called next.


OfferBestN

public OfferBestN(NegotiationSession negotiationSession,
                  OpponentModel model,
                  int n)
Normal constructor used to initialize the OfferBestN opponent model strategy.

Parameters:
negotiationSession - symbolizing the negotiation state.
model - opponent model strategy used by this opponent model strategy.
n - amount of best bids from which a random bid is selected.
Method Detail

init

public void init(NegotiationSession negotiationSession,
                 OpponentModel model,
                 java.util.HashMap<java.lang.String,java.lang.Double> parameters)
          throws java.lang.Exception
Initializes the agent by storing the size of the domain, and checking if the domain is large.

Overrides:
init in class OMStrategy
Parameters:
negotiationSession - state of the negotiation.
model - opponent model used in conjunction with this opponent modeling strategy.
parameters - set of parameters for this opponent model strategy.
Throws:
java.lang.Exception - thrown when initializing the opponent model strategy fails.

getBid

public BidDetails getBid(java.util.List<BidDetails> allBids)
First this method determines the N best bids given the array of similarly preferred bids. Next, a random bid is offered from this set.

Specified by:
getBid in class OMStrategy
Parameters:
allBids - list of similarly preferred bids.
Returns:
random bid from the subset of N best bids in the given set.

canUpdateOM

public boolean canUpdateOM()
Specifies that the opponent model may be updated when the current time is smaller than the deadline.

Specified by:
canUpdateOM in class OMStrategy
Returns:
true if the model may be updated